<script>
export default {
    render: function(createElement) {
        this.value = this.formatter ? this.formatter(this.data[this.info.prop]) : this.data[this.info.prop]
        let cc = eval("(" + this.Element + ")");
        return cc;
    },
    props: ["data", "info", "Index", 'formatter'],
    data() {
        return {
            value: null,
            publicPath: process.env.BASE_URL
        };
    },
    created() {
        this.BaseSet();
    },
    computed: {
        Element () {
            // Avie_table_base_txt
            return `
                    createElement('div',{
                        class:'white_space',
                        domProps:{
                            innerHTML: this.value
                        },
                    })
                `
        }
    },
    watch: {
        data: {
            deep: true,
            handler: function(v) {
                this.value = v[this.info.prop];
            }
        }
    },
    methods: {
        BaseSet() {
            if (this.info.render) {
                this.Element = this.info.render;
            }
        }
    }
};
</script>

<style lang="scss" scoped>
.white_space{
    white-space: break-spaces;
    line-height: 1.6;
}
</style>